package info.openlvb.openface.client.handler;

import info.openlvb.openface.client.base.person.AddPersonPanel;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.CheckBox;

public class ChkRepPersoHandler implements ClickHandler {

	private AddPersonPanel app;

	public ChkRepPersoHandler(AddPersonPanel app){
		this.app = app;
	}
	@SuppressWarnings("deprecation")
	public void onClick(ClickEvent event) {
		boolean checked = ((CheckBox) event.getSource()).isChecked();
		if(checked){
			app.getRepPerso().setValue("/home/openlvb/"+app.getLogin().getValueAsString());
		}else{
			app.getRepPerso().setValue("");
		}
	}

}
